package com.aspose.cells.b.a.d;

public abstract class zq {
   public void a() throws Exception {
      this.a(true);
   }

   protected abstract void a(boolean var1) throws Exception;

   public abstract int c() throws Exception;

   public abstract int d() throws Exception;

   public int a(char[] var1, int var2, int var3) throws Exception {
      if (var1 == null) {
         throw new NullPointerException("buffer");
      } else if (var2 < 0) {
         throw new IndexOutOfBoundsException("index");
      } else if (var3 < 0) {
         throw new IndexOutOfBoundsException("count");
      } else if (var1.length - var2 < var3) {
         throw new IllegalArgumentException("index and count don't match buffer length");
      } else {
         int var4 = 0;

         do {
            int var5 = this.d();
            if (var5 == -1) {
               break;
            }

            var1[var2 + var4++] = (char)var5;
         } while(var4 < var3);

         return var4;
      }
   }

   public String e() throws Exception {
      char[] var1 = new char[4096];
      StringBuilder var3 = new StringBuilder(4096);

      int var2;
      while((var2 = this.a(var1, 0, var1.length)) != 0) {
         var3.append(var1, 0, var2);
      }

      return var3.toString();
   }

   public String f() throws Exception {
      StringBuilder var1 = new StringBuilder();

      while(true) {
         int var2 = this.d();
         if (var2 == -1) {
            if (var1.length() > 0) {
               return var1.toString();
            }

            return null;
         }

         if (var2 == 13 || var2 == 10) {
            if (var2 == 13 && this.c() == 10) {
               this.d();
            }

            return var1.toString();
         }

         var1.append((char)var2);
      }
   }
}
